<template>
  <div class="home-h5-container">
    <MatchTab v-if="tab === Tabs.MATCH" />
    <UserTab v-else />
    <div class="home-h5-tabbar">
      <div class="home-h5-tabbar-item" :class="{ active: tab === Tabs.MATCH }" @click="tab = Tabs.MATCH">
        <el-icon>
          <Collection />
        </el-icon>
        <span>赛事</span>
      </div>
      <div class="home-h5-tabbar-item" :class="{ active: tab === Tabs.USER }" @click="tab = Tabs.USER">
        <el-icon>
          <User />
        </el-icon>
        <span>个人</span>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { Collection, User } from '@element-plus/icons-vue'
import { ref } from "vue"
import MatchTab from './MatchTab.vue'
import UserTab from './UserTab.vue'
const enum Tabs {
  MATCH = 'match',
  USER = 'user'
}
const tab = ref<Tabs>(Tabs.MATCH)
</script>

<style scoped>
.home-h5-container {
  min-height: 100vh;
  background: #f5f6fa;
  padding: 0 0 70px 0;
  box-sizing: border-box;

  display: flex;
  flex-direction: column;
}

.home-h5-header {
  padding: 24px 20px 10px 20px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.home-h5-status-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px 10px 20px;
  background: #fff;
}

.home-h5-title {
  font-size: 18px;
  font-weight: bold;
  color: #222;
}

.no-match-info-tips {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-h5-card {
  background: #fff;
  border-radius: 12px;
  margin: 16px 16px 0 16px;
  padding: 18px 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.home-h5-row {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  font-size: 14px;
  font-weight: bold;
  color: #333;
  margin-bottom: 10px;
}

.home-h5-row:last-child {
  /* margin-bottom: 0; */
}

.home-h5-question-count {
  /* color: #409eff; */
  font-weight: normal;
  margin-left: 10px;
}

.home-h5-desc {
  margin-top: 16px;
  min-height: 100px;
  flex-direction: column;
}

.home-h5-desc-title {
  font-weight: bold;
  margin-bottom: 8px;
}

.home-h5-desc-content {
  color: #666;
  font-size: 14px;
  min-height: 60px;
  word-break: break-all;
}

/* 新增按钮样式 */
.match-status-container {
  margin: 28px auto 0;
  width: 90%;
  text-align: center;
}

.match-end-btn {
  width: 90%;
  margin: 28px 5% 0 5%;
  height: 48px;
  font-size: 14px;
  border-radius: 24px;
  color: #909399;
  border: none;
  background-color: rgb(243.9, 244.2, 244.8);
  color: var(--el-color-info-light-5) !important;
  background-color: var(--el-color-info-light-9) !important;
  border-color: var(--el-color-info-light-8) !important;

  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.home-h5-btn {
  width: 90%;
  margin: 28px 5% 0 5%;
  height: 48px;
  font-size: 14px;
  border-radius: 24px;
  color: #fff;
  border: none;
  background: #409eff;
  box-shadow: 0 2px 8px rgba(25, 190, 107, 0.08);
}

.home-h5-btn.blue,
.el-button.blue {
  background: #409eff !important;
  border-color: #409eff !important;
  color: #fff !important;
}

.home-h5-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 56px;
  background: #fff;
  border-top: 1px solid #eee;
  display: flex;
  z-index: 10;
}

.home-h5-tabbar-item {
  flex: 1;
  text-align: center;
  color: #888;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.home-h5-tabbar-item.active {
  color: #409eff;
}

.home-h5-tabbar-item .el-icon {
  font-size: 22px;
  margin-bottom: 2px;
}

/* 用户信息H5样式 */
.user-h5-card {
  margin-top: 30px;
  padding-top: 30px;
  padding-bottom: 30px;
  text-align: center;
}

.user-h5-avatar-box {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.user-h5-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0;
  font-size: 16px;
  color: #333;
  padding: 0 10px;
}

.user-h5-label {
  color: #888;
  min-width: 60px;
}

.user-h5-value {
  color: #222;
  font-weight: 500;
}

.user-h5-btn {
  width: 80%;
  margin: 24px 10%;
  height: 42px;
  font-size: 16px;
  border-radius: 21px;
}

.user-h5-dialog .el-dialog__header {
  text-align: center;
  padding-bottom: 0;
}

.user-h5-dialog-title {
  font-size: 18px;
  font-weight: bold;
  color: #222;
  margin-bottom: 10px;

  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 退出登录 */
.logout-icon {
  font-weight: bolder;
  font-size: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 5px;
  border-radius: 50%;
}

.logout-icon:hover {
  background-color: var(--el-color-info-light-8);
  transform: scale(1.2);
}

.user-h5-edit-form {
  padding: 10px 0;
}

.user-h5-edit-row {
  display: flex;
  align-items: center;
  margin: 18px 0;
  gap: 10px;
}

.user-h5-edit-avatar {
  margin-left: 10px;
}

.user-h5-dialog-content {
  flex: 1;
  background: #fff;
  border-radius: 12px;
  margin: 24px 16px 0 16px;
  padding: 18px 16px 32px 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.user-h5-section-title {
  font-size: 16px;
  font-weight: bold;
  color: #222;
  margin: 18px 0 10px 0;
}

.user-h5-avatar-row {
  flex-direction: row;
  justify-content: flex-start;
}

.user-h5-avatar-tip {
  color: #888;
  font-size: 14px;
}

.user-h5-label {
  color: #888;
  min-width: 70px;
  font-size: 15px;
}

.user-h5-btn {
  width: 100%;
  margin: 18px 0 0 0;
  height: 42px;
  font-size: 16px;
  border-radius: 21px;
  background: #409eff;
  border-color: #409eff;
  color: #fff;
}

.container-header-activityTag {
  margin-left: 0;
}

.container-header-activityTime {
  margin-left: 0;
  text-align: center;
}

.invitation-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 0 8px 0;
  gap: 16px;
}

.invitation-form .el-input {
  width: 100%;
}

.invitation-form .el-button {
  width: 100%;
  max-width: 320px;
  margin-top: 8px;
  font-size: 16px;
  border-radius: 20px;
  background: #409eff;
  border-color: #409eff;
  color: #fff;
}

.el-dialog__header {
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  color: #222;
}

.el-dialog__body {
  padding-top: 0;
}
</style>
